home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls061.ltr < prev    next >
Text File  |  1994-09-02  |  7KB  |  189 lines

  1. Editres for SCO Open Desktop 3.0
  2. ================================
  3.  
  4. Introduction
  5. ------------
  6.  
  7. editres is a tool for viewing the structure of X Toolkit applications,
  8. finding and setting resources, and dynamically see the results of the
  9. settings. editres displays the complete widget tree hierarchy for a
  10. specified client application. I also allows to create app-defaults
  11. files and fallback resources for applications.
  12.  
  13. This distribution is based on the version from MIT built with the Athena 
  14. Widget set. SCO had modified the original version to make use the Motif 
  15. Widget set.
  16.  
  17. This TLS only includes the X client part of editres as the necessary
  18. header files and supporting libraries are included in the standard
  19. SCO Open Desktop 3.0 distribution.
  20.  
  21. This TLS is designed to run on an SCO Open Desktop 3.0 system. You also
  22. need an SCO Open Desktop 3.0 Development system to create editres
  23. supporting applications.
  24.  
  25. Any feedback on this TLS is very welcomed.
  26.  
  27.  
  28. Installation
  29. ------------
  30.  
  31. To install this TLS, uncompress it and :
  32.  
  33.     # cd /
  34.     # tar xvf editres.tar
  35.     # chown bin /usr/bin/X11/editres /usr/lib/X11/app-defaults/Editres \
  36.       /usr/lib/X11/app-defaults/Editres-color
  37.     # chgrp bin /usr/bin/X11/editres /usr/lib/X11/app-defaults/Editres \
  38.       /usr/lib/X11/app-defaults/Editres-color
  39.     # chmod 755  /usr/bin/X11/editres
  40.     # chmod 444   /usr/lib/X11/app-defaults/Editres \
  41.                   /usr/lib/X11/app-defaults/Editres-color
  42.  
  43.     # l /usr/bin/X11/editres /usr/lib/X11/app-defaults/Editres*
  44.     -rwxr-xr-x 1 bin bin 218668 .. /usr/bin/X11/editres
  45.     -r--r--r-- 1 bin bin 11493  .. /usr/lib/X11/app-defaults/Editres
  46.     -r--r--r-- 1 bin bin 948    .. /usr/lib/X11/app-defaults/Editres-color
  47.  
  48.  
  49. How do I create a X client that supports editres
  50. ------------------------------------------------
  51.  
  52. editres is event driven. This means that you have to register and event
  53. handler for incoming editres requests with the toplevel widget. The attached 
  54. example program illustrates this :
  55.  
  56. ...
  57. #include <X11/Xmu/Editres.h>
  58.  
  59. ...
  60.  
  61.   XtAddEventHandler(toplevel, (EventMask) 0, True,
  62.                     _XEditResCheckMessages, NULL);
  63.  
  64. ...
  65.  
  66. You can build the example program with :
  67.  
  68. $ cc -o formtest formtest.c -lXm -lXmu -lXt -lX11 -lsocket
  69.  
  70. Having built this "formtest" will fully support the editres protocol.
  71.  
  72.  
  73. Example
  74. -------
  75.  
  76. /**********************************************************************************
  77.   * formtest.c: Test the constraints of the XmForm Widget
  78.   *         From:
  79.   *                   The X Window System, 
  80.   *            Programming and Applications with Xt
  81.   *                   OSF/Motif Edition
  82.   *         by
  83.   *                Douglas Young
  84.   *              Prentice Hall, 1990
  85.   *
  86.   *                 Example described on pages:      88-92
  87.   *
  88.   *
  89.   *  Copyright 1989 by Prentice Hall
  90.   *  All Rights Reserved
  91.   *
  92.   * This code is based on the OSF/Motif widget set and the X Window System
  93.   *
  94.   * Permission to use, copy, modify, and distribute this software for 
  95.   * any purpose and without fee is hereby granted, provided that the above
  96.   * copyright notice appear in all copies and that both the copyright notice
  97.   * and this permission notice appear in supporting documentation.
  98.   *
  99.   * Prentice Hall and the author disclaim all warranties with regard to 
  100.   * this software, including all implied warranties of merchantability and fitness.
  101.   * In no event shall Prentice Hall or the author be liable for any special,
  102.   * indirect or cosequential damages or any damages whatsoever resulting from 
  103.   * loss of use, data or profits, whether in an action of contract, negligence 
  104.   * or other tortious action, arising out of or in connection with the use 
  105.   * or performance of this software.
  106.   *
  107.   * Open Software Foundation is a trademark of The Open Software Foundation, Inc.
  108.   * OSF is a trademark of Open Software Foundation, Inc.
  109.   * OSF/Motif is a trademark of Open Software Foundation, Inc.
  110.   * Motif is a trademark of Open Software Foundation, Inc.
  111.   * DEC is a registered trademark of Digital Equipment Corporation
  112.   * HP is a registered trademark of the Hewlett Packard Company
  113.   * DIGITAL is a registered trademark of Digital Equipment Corporation
  114.   * X Window System is a trademark of the Massachusetts Institute of Technology
  115.   **********************************************************************************/
  116.  
  117. #include <X11/Intrinsic.h> 
  118. #include <Xm/Xm.h>
  119. #include <Xm/Form.h>
  120. #include <Xm/PushB.h>
  121. #include <X11/Xmu/Editres.h>
  122.  
  123.  
  124. char * buttons[] = {"button1", "button2", "button3"};
  125.  
  126. main(argc, argv)
  127.      int   argc;
  128.      char *argv[];
  129. {
  130.   Widget toplevel, form, wbutton[5];
  131.   int    i, n;
  132.   Arg wargs[10];
  133.   toplevel = XtInitialize(argv[0], "Formtest", NULL, 0, 
  134.                           &argc, argv);
  135.  
  136.   /* Register the Editres event handler */
  137.   XtAddEventHandler(toplevel, (EventMask) 0, True, 
  138.                     _XEditResCheckMessages, NULL);
  139.              
  140.   /*
  141.    * Create an XmForm manager widget
  142.    */
  143.   form = XtCreateManagedWidget("form", xmFormWidgetClass, 
  144.                                toplevel, NULL,0);
  145.   /*
  146.    * Add three XmPushButton widgets to the Form Widget.
  147.    */
  148.   for(i=0;i< XtNumber(buttons); i++)
  149.     wbutton[i] = XtCreateWidget(buttons[i],
  150.                                 xmPushButtonWidgetClass, 
  151.                                 form, NULL,0);
  152.   XtManageChildren(wbutton, XtNumber(buttons));
  153.   /*
  154.    * Set constraint resources for each button, setting up
  155.    * a shape like this:
  156.    *          button one
  157.    *          button two
  158.    *          button three
  159.    */
  160.   n = 0;
  161.   XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_FORM); n++;
  162.   XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM); n++;
  163.   XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  164.   XtSetValues(wbutton[0], wargs, n);
  165.   n = 0;
  166.   XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_WIDGET);n++;
  167.   XtSetArg(wargs[n], XmNtopWidget,       wbutton[0]);     n++;
  168.   XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM);  n++;
  169.   XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM);  n++;
  170.   XtSetValues(wbutton[1], wargs, n);
  171.   n = 0;
  172.   XtSetArg(wargs[n], XmNtopAttachment,   XmATTACH_WIDGET);n++;
  173.   XtSetArg(wargs[n], XmNtopWidget,       wbutton[1]);     n++;
  174.   XtSetArg(wargs[n], XmNleftAttachment,  XmATTACH_FORM);  n++;
  175.   XtSetArg(wargs[n], XmNrightAttachment, XmATTACH_FORM);  n++;
  176.   XtSetArg(wargs[n], XmNbottomAttachment,XmATTACH_FORM);  n++;
  177.   XtSetValues(wbutton[2], wargs, n);
  178.  
  179.   XtRealizeWidget(toplevel);
  180.   XtMainLoop();
  181. }
  182.  
  183. _______________________________________________________________________________
  184. Georg Edelmann                                    | george@sco.com or
  185. Technical Support                                 | scol-support@sco.com
  186. The Santa Cruz Operation Ltd.                     | (+44) (0)923 816344 (phone)
  187. Watford, WD1 8YN, United Kingdom                  | (+44) (0)923 817781 (fax)
  188.  
  189.